# 确保脚本抛出遇到的错误
###
 # @Author: your name
 # @Date: 2021-10-07 19:13:29
 # @LastEditTime: 2021-10-07 19:21:22
 # @LastEditors: Please set LastEditors
 # @Description: In User Settings Edit
 # @FilePath: \cj_nav\deploy.sh
### 
set -e

# 生成静态文件
yarn build

# 进入生成的文件夹
cd dist

# 如果是发布到自定义域名
# echo 'www.example.com' > CNAME

git init
git add -A
git commit -m 'deploy'

# 如果发布到 https://<USERNAME>.github.io/<REPO>
git push -f git@github.com:cj620/cj_nav.git master:gh-pages

cd -